from collections import Counter

dic_pok = {'2':1,'3':2,'4':3,'5':4,'6':5,'7':6,'8':7,'9':8,'T':9,'J':10,'Q':11,'K':12,'A':13}

tmp = {1:"单牌",\
2:"对子",\
3:"两对",\
4:"三条",\
5:"顺子",\
6:"同花",\
7:"葫芦",\
8:"四条",\
9:"同花顺",\
10:"同花大顺"}


all_pok_values = '23456789TJQKA'
all_pok_suits = 'DCHS'

pokers = []
for i in all_pok_values:
    for j in all_pok_suits:
        pokers.append(i+j)



def jugPokerType(player1_poker_value,player1_poker_suit):
    play1_type = 1
    #判断是否是同种花色
    if len(Counter(player1_poker_suit))>1:#不是同一花色
        dict_play1_value = Counter(player1_poker_value)
        #判断是否有相同的值出现
        len_play_value = len(dict_play1_value)
        if len(dict_play1_value)!=5:
            #有相同的值出现
            max_value_count = max(dict_play1_value.items(),key=lambda x:x[1])
            if len_play_value==4:
                play1_type = 2
            elif len_play_value==3:
                #可能是2+2+1,也可能是3+1+1
                if max_value_count[1]==3:
                    play1_type = 4
                else:
                    play1_type = 3
            else:
                #可能是4+1，也可能是3+2
                if max_value_count[1]==4:
                    play1_type = 8
                else:
                    play1_type = 7
        else:
            #没有相同值出现
            str_tem = "".join(player1_poker_value)
            if str_tem in all_pok_values:
                play1_type = 5
    else:
        #花色相同，有可能只是花色相同，也有可能是同花顺
        #花色相同，不可能有相同的牌面
        str_tem = "".join(player1_poker_value)
        if str_tem in all_pok_values:
            if str_tem==all_pok_values[-5:]:
                play1_type = 10
            else:
                play1_type = 9
        else:
            play1_type = 6
    return play1_type

import random
res_dict = {}
for m in range(10**6):
    player1 = random.sample(pokers,5)
    player1.sort(key=lambda x: (dic_pok[x[0]], x[1]))
    player1_poker_value = [i[0] for i in player1]
    player1_poker_suit = [i[1] for i in player1]
    res = jugPokerType(player1_poker_suit=player1_poker_suit,player1_poker_value=player1_poker_value)
    res_dict.setdefault(res,0)
    res_dict[res] += 1


for k,v in res_dict.items():
    print("%s：%d"% (tmp[k],v))